#ifndef URLDISKCLASS_H_
#define URLDISKCLASS_H_


#include <iostream>
#include <fstream>
#include <queue>
#include <list>
#include <sstream>

#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/bind.hpp>
#include <boost/tr1/memory.hpp>

#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

#include <ctime>

#include <cstdio>



//#include "../classes_net/DownloadParser.h"
#include "../classes_net/URL.h"
#include "../classes_outros/Config.h"
//#include "../classes_dados/ManagerBerthier.h"
//#include "../classes_dados/ThreadFunctionDatabase.h"



using namespace std;

class URLDiskClass{
public:
	URLDiskClass();
	~URLDiskClass();
	
	void writeDisk(URL t);
	URL readDisk(void);
	
	long long totalNewURLs(void);
	long long size(int id);
	long long pos(int id);
	
private:
	
	void writepos(int id, long long _save_pos);
	
	FILE * pDisk[6];
	FILE * pSaveDiskReadPos[6];
	URL tURL;
	struct _t_URL{
		char t_path[230];
		char t_dominio[60];
		char t_protocol[10];
	} *URLBuffer_IN, *URLBuffer_OUT;	

	boost::mutex urlDiskClassMutex_POS;
//	boost::mutex urlDiskClassMutex;
	boost::mutex pDiskMutex [6];
	boost::mutex urlDiskBufferOutMutex;
	boost::mutex urlDiskBufferInMutex;
};


#endif /*URLDISKCLASS_H_*/
